<?php
header("Content-Type:text/html;charset=utf-8");
require'ljsjk.php';
 $username=$_REQUEST['username'];
 $content=$_REQUEST['content'];
 date_default_timezone_set('Asia/Shanghai');
 $m_date=date("Y-m-d h:i:s");
 $password=$_REQUEST['password'];
 $sql="insert into tb_note(username,content,m_date,password) values('{$username}','{$content}','{$m_date}','{$password}')";
 $rs=$db->query($sql);
 if ($rs==true)
 {
     echo "<script language='javascript' type='text/javascript'>";
     echo "alert('许愿成功!');";
     echo "window.location.href='index.php';";
     echo "</script>";
 }
 else{
      echo "<script language='javascript' type='text/javascript'>";
     echo "alert('许愿失败!');";
     echo "window.location.href='index.php';";
     echo "</script>";
 }
 $db->close();


